package com.v5ba.encryptserver.demo.controller;

import com.v5ba.encryptserver.common.Encrypt;
import com.v5ba.encryptserver.common.RespUtil;
import com.v5ba.encryptserver.common.ResponseVO;
import com.v5ba.encryptserver.demo.po.TestPO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class HomeController {
    @PostMapping("post")
    @Encrypt
    public ResponseVO post(TestPO testPO){
        Map<String, String> param = new HashMap<>();
        param.put("username", "张三");
        return RespUtil.success(param);
    }
    @GetMapping("get")
    @Encrypt
    public ResponseVO get(TestPO testPO){
        Map<String, String> param = new HashMap<>();
        param.put("username", "张三");
        return RespUtil.success(param);
    }
    @PostMapping("hello")
    public ResponseVO hello(TestPO testPO){
        Map<String, String> param = new HashMap<>();
        param.put("username", "张三");
        return RespUtil.success(param);
    }
}
